#include <iostream>
#include <vector>

using namespace std;

void InsertSort(vector<int>& nums)
{
    int size = nums.size();
   for (int i = 0; i < size; i++)
   {
       for (int j = i; j >= 0 && nums[j] > nums[j + 1]; j--)
       {
            swap(nums[j], nums[j + 1]);
       }
   }
}

void Print(vector<int>& nums)
{
    for (auto& e : nums)
    {
        cout << e << " ";
    }
    cout << endl;
}

int main()
{
    vector<int> nums = {9, 1, 8, 6, 4, 7, 2, 5, 5, 3};
    InsertSort(nums);
    Print(nums);
    return 0;
}
